package com.hxkj.controller.article;

import com.alibaba.fastjson.JSONObject;
import com.hxkj.domain.po.FreeMarker;
import com.hxkj.service.article.FreeMakerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;

/**
 * 模板解析控制层
 * <p>
 * Created by yaosy on 2018年6月19日09:23:15
 */
@RestController
@RequestMapping("/freeMarker")
public class FreeMakerController {


    @Autowired
    private FreeMakerService freeMakerService;

    /**
     * 静态模板解析
     *
     * @param
     * @throws Exception
     */
    @RequestMapping(value = "/analyze")
    public Callable<JSONObject> analyze(@ModelAttribute FreeMarker freeMarker) throws Exception {
        return ()-> freeMakerService.analyze(freeMarker);
    }

}
